package collection;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Random;

public class SortInteger {
    public static void main(String[] args) {
        Random rand = new Random();
        List<Integer> a = new ArrayList<>();
        for (int i = 0; i < 10; i++) {
            a.add(rand.nextInt(100));
        }
        System.out.println("a:"+a);

        Collections.sort(a);
        System.out.println("a:"+a);

        Collections.reverse(a);
        System.out.println("a:"+a);
        System.out.println("第一个元素为："+a.get(0));
    }
}
